package com.avidys.jwom.client.ui;

import java.util.Vector;

import com.avidys.common.gwt.game.wom.model.Server;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;

public class UserList extends Dialog {

	private ListStore ls;

	public UserList() {
		setModal(true);
		setHeading("Servers");
		setLayout(new RowLayout(Orientation.VERTICAL));
		
		Vector <ColumnConfig> col = new Vector();
		ColumnConfig columnConfig = new ColumnConfig("id","ID",30);
		col.add(columnConfig);
		col.add(new ColumnConfig("name","Name",120));
		col.add(new ColumnConfig("url","Url",120));
		col.add(new ColumnConfig("ping","Ping",20));
		ColumnModel cm = new ColumnModel(col );
		ls = new ListStore();
		Vector models = new Vector<Server>();
//		models.add(new Server("1","2","2=3"));
		ls.add(models );
		Grid grid = new Grid(ls, cm);
		add(grid, new RowData(1.0, 1.0, new Margins()));
		grid.setBorders(true);
		
		Button btnAdd = new Button("Add");
		addButton(btnAdd);
	}

}
